<script setup lang="ts">

import {useAuthStore} from "@/stores/auth";

const auth = useAuthStore()

</script>

<template>
    <el-container class="page">
      <el-header>
        <el-space style="height: 100%;width: 100%;justify-content: space-between"  alignment="center" >
          <el-text>问卷</el-text>
          <div style="display: flex;align-items: center;gap: 10px">
            <el-menu
              mode="horizontal"
              :default-active="$route.fullPath"
              router
              active-text-color="#FF5943"
            >
              <el-menu-item index="/index">
                <template #title>首页</template>
              </el-menu-item>
              <el-menu-item index="/record-survey">
                <template #title>回答记录</template>
              </el-menu-item>
              <el-menu-item index="/self">
                <template #title>我的信息</template>
              </el-menu-item>

            </el-menu>
            <el-button @click="auth.clearToken();$router.push('/login')" type="success">退出登录 {{auth.token}}</el-button>
          </div>
        </el-space>
      </el-header>
      <el-container>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
</template>
